import request from "../../../utils/request";

class Province {
  static getprovincelist=()=>request.get('/province')
  static addprovince =async (data)=> {
    let res = await request.post("/province",data)
    console.log(res); 
    return {data:[{message:"添加成功",data:res.data,code:200}]}
  }
  // static getNav=()=>request.post('/nav')
  static delprovince=async(id)=>{
    let res = await request.delete('/province/'+id)
    return {data:[{message:'删除成功',code:200}]}
  }
  static changeprovince=async(obj)=>{
    console.log(obj.id,obj.data);
    let res = await request.patch('/province/'+obj.id,obj.data)
    console.log(res);
    return {data:[{message:'修改成功',code:200}]}
  }
  static Cprovinceflag=async(obj)=>{
    console.log(obj.id,obj.flag);
    let res = await request.patch('/province/'+obj.id,{flag:!obj.flag})
    console.log(res);
    return {data:[{message:'修改成功',code:200}]}
  }
}
export default Province